1. Field of the Invention
The present invention relates to an image generating apparatus and an image generating method. More particularly, the present invention relates to a MIP-map image generating apparatus and a MIP-map image generating method for a surface texture image of a displayed object in 3-dimensional (3D) computer graphics.
2. Description of the Related Art
Recently, in order to attain a higher reality, texture mapping methods in which textures (patterns) are provided on the surface of an object to be displayed on a display is being intensively studied in the field of computer graphics. Hereinafter, an exemplary apparatus for image generation using a conventional texture mapping method will be described with reference to the relevant figures.
With 3D computer graphics, it is necessary to convert the coordinates of a 3D image defined in a 3D coordinate system called "a world coordinate system" into coordinates in a 2-dimensional (2D) coordinate system called "a display coordinate system". The coordinates in the "display coordinate system" can be expressed as a pair of integer values. The integer values have maximum values which are equal to the numbers of pixels in the horizontal direction and the vertical direction, respectively, of the display that is to be employed. For example, in the case where the employed display has 640 pixels in the horizontal direction, and 480 pixels in the vertical direction, the x-coordinate of the display coordinates (x, y) is an integer in the range of 1 to 640, and the y-coordinate thereof is an integer in the range of 1 to 480.
In the 3D space, the minimum unit for representing a 3D image is a polyhedron called "a polygon". A distance from a view point to the polygon in the world coordinate system is simply referred to as "a distance to polygon". The distance to the polygon and the view angle determine the size of the polygon to be actually displayed on the display screen. The size of the polygon to be actually displayed on the display screen is simply referred to as "a polygon size". For example, if the distance to a polygon is small or if the view angle is small, the polygon size is relatively large. On the other hand, if the distance to a polygon is large or if the view angle is large, the polygon size is relatively small.
When a polygon is to be displayed, in order to make the graphics more realistic, it is necessary to use texture mapping for providing a texture to the surface of the polygon. In order to make the displayed image more natural, it is necessary to change the degree of pattern density of the texture depending on the polygon size. The degree of pattern density of the texture is referred to as "the size of texture". The size of texture is required to increase as the polygon size increases. For this purpose, a MIP (multum in parvo, Latin for many things in a small place) map texture mapping method is conventionally used. In the MIP-map texture mapping method, a texture pattern including a number of sizes of texture corresponding to polygon sizes is previously generated, and they are mapped to the polygon as required.
Referring to FIG. 12, the construction of a conventional apparatus for image generation using texture mapping will be described. A texture size calculator 90 calculates an appropriate size of texture corresponding to the polygon size. A MIP-map image generator 91 generates a number of various MIP-map images with different sizes of texture. A MIP-map image memory 92 stores the MIP-map images generated in the MIP-map image generator 91. The MIP-map image memory 92 receives the information related to the size of texture obtained by the texture size calculator 90, and outputs one of the stored MIP-map images corresponding to the received size of texture.
Referring to FIG. 13, a MIP-map image is described. An original texture image 95 is composed of 8.times.8 pixels, and a MIP-map image 96 is composed of 4.times.4 pixels. Herein, the "resolution" is indicated by the number of pixels in both horizontal and vertical directions constituting a texture image. Accordingly, if a texture image has a greater number of pixels, the texture image is said to have a higher resolution. The resolution of the MIP-map image 96 is 1/2 of that of the original texture image 95 in both directions. The ratio of the resolution of the MIP-map image to that of the original texture image is referred to as "a resolution ratio". The resolution ratio of the MIP-map image 96 to the original texture image 95 is 1/2 in each of both directions.
Referring back to FIG. 12, the operation of a conventional apparatus for image generation using texture mapping will be described. The original texture image 95 shown in FIG. 13 is temporarily stored in the MIP-map image memory 92. Then, the MIP-map image generator 91 receives the original texture image 95 from the MIP-map image memory 92. The MIP-map image generator 91 generates MIP-map images having various resolutions from the original texture image 95, and outputs the MIP-map image to the MIP-map image memory 92. The MIP-map image memory 92 stores the generated MIP-map image. For example, when a MIP-map image with 4.times.4 pixels is to be generated from an original texture image of 8.times.8 pixels as shown in FIG. 13, the original texture image is first divided into blocks each comprising 2.times.2 pixels, and one of the pixels in one divided block is output as one pixel of the MIP-map image.
The texture size calculator 90 calculates the resolution of the MIP-map image corresponding to the size of the polygon that is to be displayed. In addition, the texture size calculator 90 calculates the resolution ratio, i.e., the ratio of the resolution of the MIP-map image to that of the original texture image. The obtained information of the resolution ratio is applied to the MIP-map image memory 92. In the case shown in FIG. 13, the information that the resolution ratio is 1/2 is applied to the MIP-map image memory 92.
The MIP-map image memory 92 selects and outputs a MIP-map image, for example, corresponding to the resolution of 1/2 from the previously stored MIP-map images.
However, the above-described conventional method involves the following problems. In order to store various MIP-map images with a plurality of different resolutions which have been previously generated, the MIP-map image memory is required to have a large capacity. The greater the number of texture patterns, the MIP-map image memory is required to be very large.
Furthermore, in general, the normal of a face onto which the MIP-map is mapped does not coincide with a view direction. Therefore, in some cases, the length-to-width ratio of the MIP-map image does not coincide with the length-to-width ratio of the original texture image. This means that it is necessary to prepare a vertically long texture pattern or a wide texture pattern as a MIP-map image. For this reason, the memory capacity is required to increase.